Network address translation (NAT) devices provide an interface between public networks (e.g., the Internet) and private networks (e.g., home networks and business intranets). In one operational implementation, a NAT device allows multiple IP nodes on the internal private network to share a single public IP address on the public network. The NAT device translates the internal private addresses to a registered unique public address, translates the external registered address(es) to private addresses that are unique to the private network, and maps these connections through ports. NAT devices can accommodate multiple connections between the public and private networks via port mapping in a NAT address mapping and/or port mapping database or table. When a sharing node of the private domain sends outbound traffic, the NAT device forwards the traffic and creates a reverse mapping entry in the table for the sharing node. This reverse entry is used to redirect responses from the public domain back into the private domain to the correct sharing node.
Typical NAT devices have a configurable timeout period for port mapping state. If a specific table entry is not used by inbound or outbound traffic for longer than the timeout period, the NAT timer expires and the entry is purged from the table. Once the entry is purged, the sharing node in the private domain can no longer be reached over this connection and a new connection has to be initiated by the sharing node. A common mechanism to prevent the NAT timer from expiring is known as “keep-alive”. Here, useless (or keep-alive) packet traffic is generated over the connection at shorter intervals than the NAT timeout period to fool the NAT into believing that the connection is active.
There are at least two conventional ways to guarantee that the keep-alive intervals are shorter than the NAT timeout intervals. First, a fixed keep-alive interval that is known to be shorter than all or most NATs on the market can be configured into the NAT device. Second, the keep-alive interval can be dynamically adjusted based on an adaptive computation (based on previous observed history). The adaptive method provides a more sophisticated technique by increasing the interval value periodically and reducing the interval if the connection fails.
In the context of mobile devices such as smart phones, for example, neither of the above approaches is satisfactory. A very short fixed interval, such as thirty seconds dramatically impacts battery life by increasing battery drain and generating significant network traffic overhead. Additionally, the on-going adaptive keep-alive mechanism is sub-optimal for mobile devices for the following reasons. If used on the main connection, the adaptive method will periodically cause a disconnect in the connection, since this is the indication that the attempted interval is too long. Even if used on a secondary connection—if done sequentially, the adaptive method takes substantial time to gather sufficient historical data to converge on the right value. Further, it is difficult to distinguish between connection failure due to NAT timeouts versus other network failures when using the adaptive method. Thus, in a low quality mobile network, the computation may fail often (e.g., due to a loss of connectivity from to roaming between networks). Finally, even when none of the other failures occur, the computed value for the adaptive method is only good as long as the mobile device is not roaming. In mobile environments, it is likely that by the time the correct interval is computed using the adaptive method, the device has already roamed to a different network.